<template>
  <fragment>
    <template v-for="item in menus">
      <el-submenu v-if="item.children" :index="item.uid">
        <template slot="title">
          <i :class="item.icon"></i>
          <span slot="title">{{$t('menu.' + item.code)}}</span>
        </template>
        <Sidebar :menus="item.children"></Sidebar>
      </el-submenu>
      <el-menu-item v-else :index="item.path">
        <i v-if="item.icon" :class="item.icon"></i>
        <span slot="title">{{$t('menu.' + item.code)}}</span>
      </el-menu-item>
    </template>
  </fragment>
</template>

<script>

  export default {
    name: "Sidebar",
    props: {
      menus: {
        type: Array
      }
    }
  }
</script>
